package com.cloud.form.api.enums;

import java.util.HashMap;
import java.util.Map;

public enum YesNoEnum {
	NO(0), YES(1);
	private static final Map<Integer, YesNoEnum> enumMap = new HashMap<Integer, YesNoEnum>();

	static {
		for (YesNoEnum yseNo : YesNoEnum.values()) {
			enumMap.put(yseNo.getCode(), yseNo);
		}
	}

	private int code;

	private YesNoEnum(int code) {
		this.code = code;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public static YesNoEnum getYesNo(Integer code) {
		return enumMap.get(code);
	}

}
